package Singleton;

/**
 * Created by wangyg 
 * on 2017/6/13 19:12
 */
public class FirstLoadSingleton {
	private static FirstLoadSingleton instance = new FirstLoadSingleton();

	private FirstLoadSingleton() {
	}

	public static FirstLoadSingleton getInstance() {
		Thread.yield();
		return instance;
	}

	public static void main(String[] args) throws InterruptedException {
		for (int i = 0; i < 10; i++) {
			new Thread() {
				public void run() {

					System.out.println(Thread.currentThread().getName() + ":" + FirstLoadSingleton.getInstance().hashCode());

				}
			}.start();
//			Thread.sleep(600);
		}
		//		System.out.println(FirstLoadSingleton.getInstance());
	}
}
